<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="display" uri="http://displaytag.sf.net" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
<link href="style/store.css" rel="stylesheet" type="text/css">
<link href="style/displaytagex.css" rel="stylesheet" type="text/css">
	<script type="text/javascript">
		
		function viewAsChart(){
			window.open('viewAsChartAction.action');
		}
	
	</script>
</head>
<body>
<form name="formName" method="post">
	<s:hidden name="isListEmpty" />
	<table align="center">
		<tr>
			<td>
				<span class="error" >
					<s:actionerror/>
					<s:actionmessage/>
				</span>
			</td>
		</tr>
	</table>
	<table align="center" width="35%">
		<tr>
			<td colspan="3" class="verdana" height="30" align="center" bgcolor="#336699">
				<font color="#ffffff">Top Selling Products</font>
			</td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Top:</label></td>
			<td><s:radio label="Answer" name="topanswer" list="#{'10':'Ten','30':'Thirty','50':'Fifty'}" /></td>
			<td><s:submit cssClass="button" value="Submit" action="doGetSoldProductsAction" ></s:submit>
		</tr>
	</table>
</form>
	<br>
	<center>
	<s:set name="soldProductsList" value="soldProductsList" scope="request"></s:set>
	<display:table name="soldProductsList" uid="row" pagesize="50" class="dataTable"
	requestURI="doGetSoldProductsAction.action">
		<display:column title="#"> 
  		   ${row_rowNum}
 		 </display:column>
		<display:column property="prodId" title="Product ID"></display:column>
		<display:column property="product.name" title="Product Name" sortable="true"></display:column>
		<display:column property="units" title="Sold Units"></display:column>
		<display:column property="solddate" title="Last Sold Date"></display:column>
		<display:setProperty name="paging.banner.placement" value="top" />
	</display:table>
	</center>
	<s:if test="isListEmpty == 0 ">
		<table align="right" border="1" align="center" width="50%" >
			<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
				<td width="61%" align="right" style="padding-right: 10px" ><input type="button" onclick="viewAsChart();" value="View as Chart" class="button" /> </td>
			</tr>
		</table>
	</s:if>
</body>
</html>